<template>
  <view class="page-company">
    <view class="header">
      <view class="title">{{ $t('activity.活动详情') }}</view>
      <uni-icons type="left" color="#ffffff" size="24" class="back-icon" @click="handleBack"></uni-icons>
    </view>
    <view class="content">
      <rich-text :nodes="richText"></rich-text>
    </view>
  </view>
</template>
<script>
  import { articleDetail } from '@/api/company.js'

  export default {
    onLoad(option) {
      let { id } = option
      this.id = id
      this.getData()
    },
    data() {
      return {
        richText: '',
        id: ''
      }
    },
    methods: {
      // 返回
      handleBack() {
        // this.$tab.navigateBack()
        this.$tab.navigateTo('/pages/mine/notice/index')
      },
      //获取数据
      getData() {
        this.$modal.loading('loading', 'loading')
        articleDetail({
          id: this.id
        })
          .then((res) => {
            this.$modal.closeLoading()
            let { data } = res.result
            let { content } = data
            this.richText = content
          })
          .catch((err) => {
            this.$modal.closeLoading()
          })
      }
    }
  }
</script>
<style lang="scss" scoped>
  .page-company {
    position: relative;
    .header {
      background-color: #31b2b5;
      text-align: center;
      height: 44px;
      line-height: 44px;
      position: fixed;
      top: 0;
      width: 100vw;
      color: #fff;

      font-size: 26rpx;
      z-index: 9;
      .back-icon {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        font-weight: normal;
      }
    }
    .content {
      margin: 100rpx 20rpx 20rpx;
      overflow-x: hidden;
    }
  }
</style>
